#include <iostream>
#include <vector>

using namespace std;

int eraseOverlapIntervals(vector<vector<int>>& in) {
    sort(in.begin(), in.end(), [](vector<int>& v1, vector<int>& v2) {
        return v1[0] < v2[0];
        });

    int ret = 0;
    int right = in[0][1];
    for (int i = 1; i < in.size(); ++i)
    {
        int a = in[i][0], b = in[i][1];
        if (a < right)
        {
            right = min(right, b);
            ++ret;
        }
        else
        {
            right = b;
        }
    }

    return ret;
}

int main()
{

	return 0;
}